/**
 * created by 小卷毛, 2022-07-01
 * Copyright (c) 2022, 416143467@qq.com All Rights Reserved.
 * #                   *********                            #
 * #                  ************                          #
 * #                  *************                         #
 * #                 **  ***********                        #
 * #                ***  ****** *****                       #
 * #                *** *******   ****                      #
 * #               ***  ********** ****                     #
 * #              ****  *********** ****                    #
 * #            *****   ***********  *****                  #
 * #           ******   *** ********   *****                #
 * #           *****   ***   ********   ******              #
 * #          ******   ***  ***********   ******            #
 * #         ******   **** **************  ******           #
 * #        *******  ********************* *******          #
 * #        *******  ******************************         #
 * #       *******  ****** ***************** *******        #
 * #       *******  ****** ****** *********   ******        #
 * #       *******    **  ******   ******     ******        #
 * #       *******        ******    *****     *****         #
 * #        ******        *****     *****     ****          #
 * #         *****        ****      *****     ***           #
 * #          *****       ***        ***      *             #
 * #            **       ****        ****                   #
 */
package com.rzico.sbl.ui.report.other

import android.content.Context
import androidx.fragment.app.Fragment
import com.rzico.sbl.other.serviceId
import com.rzico.sbl.ui.report.ReportBuyActivity
import com.rzico.sbl.ui.report.ReportOrderDetailActivity
import com.rzico.sbl.ui.report.dispatch.ReportDispatchThirdActivity
import com.rzico.sbl.ui.report_023.CQOfficeOrderActivity
import com.rzico.sbl.ui.report_0537.QFOfficeOrderActivity
import com.rzico.sbl.ui.report_0537.QFReportBuyActivity
import com.rzico.sbl.ui.report_0537.QFReportDispatchThirdActivity
import com.xinnuo.common.extend.startActivityEx

/**
 * 描 述：报货系统根据服务商跳转页面控制器
 * 作 者：小卷毛  2022-07-01 14:13
 * 修改描述：
 * 修 改 人：
 * 修改版本：
 */

/**
 * 曲阜报货跳转采购单页面
 */
fun Context.goToBuy() {
    when (serviceId) {
        in ReportService.MODE_FINANCE ->
            startActivityEx<QFReportBuyActivity>()
        else -> startActivityEx<ReportBuyActivity>()
    }
}

/**
 * 曲阜报货送达跳转第三步
 */
fun Context.goToDispatchThird(vararg params: Pair<String, Any?>) {
    when (serviceId) {
        in ReportService.MODE_FINANCE ->
            startActivityEx<QFReportDispatchThirdActivity>(params = params)
        else -> startActivityEx<ReportDispatchThirdActivity>(params = params)
    }
}

/**
 * 重庆、西安报货跳转办公室订单页面
 */
fun Fragment.goToOffice() {
    when (serviceId) {
        in ReportService.MODE_OFFICE ->
            startActivityEx<CQOfficeOrderActivity>()
        else -> startActivityEx<QFOfficeOrderActivity>()
    }
}

/**
 * 西安报货跳转订单详情页面
 */
fun Context.goToOrderDetail(vararg params: Pair<String, Any?>) {
    startActivityEx<ReportOrderDetailActivity>(params = params)
}